package com.example.wordlistdemo;

import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;

public class WordListActivity extends AppCompatActivity {

    private List<WordEntity> wordList;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_word_list);

        // 假设根据索引获取对应的单词列表数据
        Intent intent = getIntent();
        wordList =  (List<WordEntity>) intent.getSerializableExtra("wordList"); // 假设实现了这个方法
        RecyclerView recyclerView = findViewById(R.id.recycler_view_word_list);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setAdapter(new WordAdapter(this,wordList));
    }
}

